
#include <iostream>

using namespace std;

struct A {
public:
	A() {
		cout << "call ()" << endl;
	}
	~A()
	{
		cout << "call ~" << endl;
	}
	A(const A & a)
	{
		v = a.v;
		cout << "call (&)" << endl;
	}
	void operator = (const A & a)
	{
		v = a.v;
		cout << "call =(&)" << endl;
	}
	int v = ++s;
	static int s;
};

int A::s = 0;

A GetA()
{
	A a;
	cout << a.v << endl;
	return a;
}


int main()
{
	A a1 = GetA();
	A a2(GetA());
	A a3{GetA()};

	cout << "a1 " << a1.v << endl;
	cout << "a2 " << a2.v << endl;
	cout << "a3 " << a3.v << endl;

	cout << A::s << endl; // ?
	return 0;
}
